package com.wlc.config.rabbitconfirm;

import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @author 王立朝
 * @description 消息发送确认类
 * @date 2021-12-15 10:31:48
 */

public class RabbitConfirmCallback implements RabbitTemplate.ConfirmCallback {

    /**
     * Confirmation callback.
     *
     * @param correlationData correlation data for the callback.
     * @param ack             true for ack, false for nack
     * @param cause           An optional cause, for nack, when available, otherwise null.
     */
    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        System.out.println("=======ConfirmCallback 消息发送确认类开始=========");
        System.out.println("correlationData = " + correlationData);
        System.out.println("ack = " + ack);
        System.out.println("cause = " + cause);
        System.out.println("=======ConfirmCallback 消息发送确认类结束=========");

    }
}
